<?php

namespace app\api\controller;

use app\common\controller\Api;
use think\Db;
/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['index'];
    protected $noNeedRight = ['*'];

    /**
     * 首页
     *
     */
    public function index()
    {
        $this->success('请求成功');
    }

    public function getbanner()
    {

        $banner = Db::name('banner')->where('status', 1)->select();

        foreach ($banner as $key => $value){
            $banner[$key]['img'] = cdnurl($value['image'],true);
        }

        $this->success('幻灯片',$banner);
    }

    //x详细信息
    public function getaddress(){

        $id=$this->request->param('id');

        $address = Db::name('address')->where(['id'=>$id])->find();

        $this->success('基础信息',$address);

    }
    public function getmobile(){

        $mobile=['80000000001','80000000002'];

        $this->success('关于我们',$mobile);

    }

}
